<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>12-翻转数组</title>
	</head>
	<body>
		<script type="text/javascript">
			//初始化一个数组并赋值(元素)
			var arr = ['上海','北京','深圳','成都','西安'];
			var newArr = [];
			console.log("长度::"+arr.length);//5
			//西安的下标是4
			//循环
			for(var i=arr.length-1;i>=0;i--){
				newArr[newArr.length] = arr[i];
			}
			//新数组::西安,成都,深圳,北京,上海
			console.log('新数组::'+newArr);
		</script>
	</body>
</html>
